package org.example.ReflectDemo.test1;

public class HouseProxy implements HouseSubject{
    private HouseSubject houseSubject;
    public HouseProxy(HouseSubject houseSubject){
        this.houseSubject=houseSubject;
    }
    @Override
    public void rentHouse() {
        System.out.println("我是中介，代理开始");
        houseSubject.rentHouse();
        System.out.println("我是中介，代理结束");
    }

    @Override
    public void saleHouse() {
        System.out.println("我是中介，代理开始");
        houseSubject.saleHouse();
        System.out.println("我是中介，代理结束");
    }

}
